CXXFLAGS=-g -std=c++11
main: time_test boost_test lock_test observer_01 observer_02 weak_pointer observer_03 func thread_test pointer_container thread_pool_test

boost_test: boost_test.cc
	g++ -g -o boost_test boost_test.cc

lock_test: lock_test.cc ../mars/libmars.a
	g++ ${CXXFLAGS} -o lock_test lock_test.cc -L../mars -lpthread -lmars

observer_01: observer_01.cc ../mars/libmars.a
	g++ ${CXXFLAGS} -o observer_01 observer_01.cc -L../mars -lpthread -lmars

observer_02: observer_02.cc ../mars/libmars.a
	g++ ${CXXFLAGS} -o observer_02 observer_02.cc -L../mars -lpthread -lmars

observer_03: observer_03.cc ../mars/libmars.a
	g++ ${CXXFLAGS} -o observer_03 observer_03.cc -L../mars -lpthread -lmars

weak_pointer: weak_pointer.cc
	g++ -g -o weak_pointer weak_pointer.cc

func: func.cc
	g++ ${CXXFLAGS} -o func func.cc

time_test: time_test.cc ../mars/libmars.a
	g++ ${CXXFLAGS} -o time_test time_test.cc -L../mars -lpthread -lmars

pointer_container: pointer_container.cc
	g++ ${CXXFLAGS} -o pointer_container pointer_container.cc

thread_test: thread_test.cc ../mars/libmars.a
	g++ ${CXXFLAGS} -o thread_test thread_test.cc -L../mars -lpthread -lmars

thread_pool_test: thread_pool_test.cc ../mars/libmars.a
	g++ ${CXXFLAGS} -o thread_pool_test thread_pool_test.cc -L../mars -lpthread -lmars

../mars/libmars.a: ../mars
	$(MAKE) -C ../mars

.PHONY: main
